#include<stdio.h>

void my_sort(int arr[],int x){
	int i=0,j,temp;
	for(i=0;i<x-1;i++){
		for(j=0;j<x-1-i;j++){
			if(arr[j]>arr[j+1]){
				temp=arr[j];
				arr[j]=arr[j+1];
				arr[j+1]=temp;
			}
		}
	}
}
int main()
{
	int arr[10000];
	printf("please enter a series of number,and enter 'q' to quit:\n");
	int b,i=0,cnt=1;
	b=(scanf("%d",&arr[i]));
	for(i=1;b!=0;i++){
		b=(scanf("%d",&arr[i]));
		cnt++;
	}
	cnt-=1;
	my_sort(arr,cnt);
	
	for(int h=0;h<cnt;h++)
	   printf("%d  ",arr[h]);
}